package com.tyjc.unique.view;

import android.content.Context;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.tyjc.lottery.R;
import com.fyzk.utils.LogUtil;


public class PrizeSsqView extends RelativeLayout {

	private TextView num1, num2, num3, num4, num5, num6, num7;

	private Context context;
	
	private TextView[] views;

	public PrizeSsqView(Context context) {
		super(context);
		this.context = context;
		init();
	}

	private void init() {
		View.inflate(context, R.layout.layout_ssq_prizeitem, this);
		num1 = (TextView) findViewById(R.id.ball_num1);
		num2 = (TextView) findViewById(R.id.ball_num2);
		num3 = (TextView) findViewById(R.id.ball_num3);
		num4 = (TextView) findViewById(R.id.ball_num4);
		num5 = (TextView) findViewById(R.id.ball_num5);
		num6 = (TextView) findViewById(R.id.ball_num6);
		num7 = (TextView) findViewById(R.id.ball_num7);
		views = new TextView[]{num1,num2,num3,num4,num5,num6,num7};
	}

	public void setNum(int num[]) {
		try {
			for (int i = 0; i < 7; i++) {
				String numShow = "00";
				if(num[i]>9){
					numShow = num[i]+"";
				}else{
					numShow = "0"+num[i];
				}
				views[i].setText(numShow);
			}
		} catch (Exception e) {
			LogUtil.e("双色球开奖号报错了！！！");
		}
	}

}
